load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "amazon",
    srcs = [
        "aws_kms.go",
        "aws_kms_connection.go",
        "s3_connection.go",
        "s3_storage.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cloud/amazon",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/cloud",
        "//pkg/cloud/cloudpb",
        "//pkg/cloud/externalconn",
        "//pkg/cloud/externalconn/connectionpb",
        "//pkg/cloud/externalconn/utils",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/util/envutil",
        "//pkg/util/ioctx",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_aws_aws_sdk_go//aws",
        "@com_github_aws_aws_sdk_go//aws/awserr",
        "@com_github_aws_aws_sdk_go//aws/client",
        "@com_github_aws_aws_sdk_go//aws/credentials",
        "@com_github_aws_aws_sdk_go//aws/credentials/stscreds",
        "@com_github_aws_aws_sdk_go//aws/request",
        "@com_github_aws_aws_sdk_go//aws/session",
        "@com_github_aws_aws_sdk_go//service/kms",
        "@com_github_aws_aws_sdk_go//service/s3",
        "@com_github_aws_aws_sdk_go//service/s3/s3manager",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@io_opentelemetry_go_otel//attribute",
    ],
)

go_test(
    name = "amazon_test",
    size = "small",
    srcs = [
        "aws_kms_test.go",
        "s3_storage_test.go",
    ],
    embed = [":amazon"],
    deps = [
        "//pkg/base",
        "//pkg/blobs",
        "//pkg/cloud",
        "//pkg/cloud/cloudpb",
        "//pkg/cloud/cloudtestutils",
        "//pkg/security/username",
        "//pkg/settings/cluster",
        "//pkg/testutils",
        "//pkg/testutils/skip",
        "//pkg/util/leaktest",
        "@com_github_aws_aws_sdk_go//aws/awserr",
        "@com_github_aws_aws_sdk_go//aws/credentials",
        "@com_github_aws_aws_sdk_go//aws/request",
        "@com_github_aws_aws_sdk_go//service/s3",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
